<template>
  <el-menu
      :style="{width: !isCollapse ?'230px':'64px'}"
      active-text-color="#ffd04b"
      background-color="#545c64"
      class="aside-container"
      default-active="2"
      text-color="#fff"
      @open="handleOpen"
      @close="handleClose"
      :collapse="isCollapse"
  >
    <p class="log-lg">{{isCollapse ? '墨韵' : ' 墨韵教育系统' }}</p>
    <TreeMenu :menuData="menuData"/>
  </el-menu>
</template>
<script setup>
import TreeMenu from "./treeMenu.vue";
import {useRouter} from 'vue-router';
import {reactive,computed} from 'vue'
import {useStore} from 'vuex'

const router = useRouter();
const store=useStore();
// const menuData=reactive(router.options.routes[0].children);
const menuData=computed(()=> store.state.menu.routerList)
const isCollapse=computed(()=> store.state.menu.isCollapse)
console.log(router);
const handleOpen = () => {

}
const handleClose = () => {

}
</script>
<style lang="less" scoped>
.aside-container {
  height: 100%;
  .log-lg{
    font-size: 20px;
    color: #fff;
    text-align: center;
    height: 50px;
    line-height: 50px;
  }
}
</style>
